package cn.ggy.service;

import cn.ggy.dao.StuDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service("stuService2")
public class StuServiceImpl2 implements StuService{

//    //导入stuDao对象
//    @Autowired
//    @Qualifier("stuDaoImpl2")   //这里面写谁就相当于把id设置为谁
//    private StuDao stuDao;

    @Resource(name = "stuDaoImpl")//会按照赋值进行注入
    private StuDao stuDaoImpl2;
    public void getStu() {
        stuDaoImpl2.getStu();
    }
}
